//
//  ViewController.m
//  CycleAlertView-demo
//
//  Created by 苹果笔记本 on 2020/5/15.
//  Copyright © 2020 苹果笔记本. All rights reserved.
//

#import "ViewController.h"
#import "ShowViewController.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setTitle:@"底部弹出" forState:UIControlStateNormal];
    [btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [btn setBackgroundColor:[UIColor redColor]];
    [btn addTarget:self action:@selector(bottomClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];
    btn.frame = CGRectMake(50, 100, 100, 40);
    
    
    UIButton *btn1 = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn1 setTitle:@"中间弹出" forState:UIControlStateNormal];
    [btn1 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [btn1 setBackgroundColor:[UIColor redColor]];
    [btn1 addTarget:self action:@selector(centerClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn1];
    btn1.frame = CGRectMake(160, 100, 100, 40);
}
//底部弹出
- (void)bottomClick {
    [[ShowViewController new] showFromBottom];
    
}
//中间弹出
- (void)centerClick {
    [[ShowViewController new] showFromCenter];
    
}
@end
